<?php
/********************************************************************
Product    : Plotalot
Date       : 15 April 2011
Copyright  : Les Arbres Design 2010-2011
Contact    : http://extensions.lesarbresdesign.info
Licence    : GNU General Public License
*********************************************************************/

defined('_JEXEC') or die('Restricted Access');

jimport('joomla.application.component.controller');

define("LA_COMPONENT", "com_plotalot");
define("LA_COMPONENT_LINK", "index.php?option=".LA_COMPONENT);
define("LA_COMPONENT_NAME", "Plotalot");
define("ADMIN_ASSETS_URL", JURI::root().'administrator/components/'.LA_COMPONENT.'/assets/');
if (file_exists(JPATH_ROOT.DS.'LA.php'))
	require_once JPATH_ROOT.DS.'LA.php';

// load the Plotalot class file here to make its constants available everywhere

require_once JPATH_COMPONENT.DS.'helpers'.DS.'plotalot.php';

// load our css and javascript

$document = & JFactory::getDocument();
$document->addStyleSheet(JURI::base().'components/'.LA_COMPONENT.'/assets/'.LA_COMPONENT.'.css');
$document->addScript(JURI::base().'components/'.LA_COMPONENT.'/assets/jscolor.js');

// from Joomla 1.6.2 we need to load the Javascript framework

$version = new JVersion();
$joomla_version = $version->RELEASE;
if ($joomla_version >= '1.6')
	JHtml::_('behavior.framework');	// load the Joomla Javascript framework

// create an instance of the controller and tell it to execute $task

require_once( JPATH_COMPONENT.DS.'controller.php' );
$controller	= new PlotalotController( );

$task = JRequest::getVar('task');

$controller->execute($task);

$controller->redirect();